package cn.itcast.bos.web.base.action;

import domain.base.TakeTime;
import cn.itcast.bos.service.base.TakeTimeService;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.convention.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * Created by Administrator on 2017/7/16/016.
 */
@ParentPackage("json-default")
@Namespace("/")
@Controller
@Actions
@Scope("prototype")
public class TakeTimeAction extends BaseAction<TakeTime,TakeTimeService>{

    @Autowired
    TakeTimeService takeTimeService;

    @Action(value = "taketime_findAll",results = {
            @Result(name = "success",type = "json")
    })
    public String findAll(){
       List<TakeTime> list = takeTimeService.findAll();
        ActionContext.getContext().getValueStack().push(list);
        return SUCCESS;
    }

}
